<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>视频信息管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/play.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="assets/css/offcanvas.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/play.css" rel="stylesheet">
    <script src="assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<!--导航栏-->
<nav class="navbar navbar-fixed-top navbar-inverse">
    <div class="container-fluid">

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">

                <li><a href="index.php?c=index&m=index">首页</a></li>
                <?php
                foreach($data['videotypes'] as $list){
                    echo "<li><a href=index.php?c=index&m=listPage&tid={$list['tid']}>".$list['typename']."</a></li>";
                }
                ?>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<!--导航栏end-->


<div class="container"><!--这个div包含了几乎主页的所有内容，匹配到最后的div-->

    <!--幻灯片开始-->
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>

        <div class="carousel-inner">
            <div class="item active">
                <img src="assets/images/img4.jpg" class="img-responsive" alt="Apple iPhone 5S">

                <div class="carousel-caption">
                    <h3>Apple iPhone 5S</h3>

                </div>
            </div>
            <div class="item">
                <img src="assets/images/img2.jpg" class="img-responsive" alt="Samsung Galaxy Note 3">

                <div class="carousel-caption">
                    <h3>Samsung Galaxy Note 3</h3>

                </div>
            </div>
            <div class="item">
                <img src="assets/images/img3.jpg" class="img-responsive" alt="Apple iPhone 5S">

                <div class="carousel-caption">
                    <h3>Sony Xperia Z1</h3>

                </div>
            </div>
        </div>

        <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
    </div>
    <!--幻灯片结束-->


    <div class="row row-offcanvas row-offcanvas-right"><!--第二大div，一直到倒数第二个div-->



        <div class="col-xs-12 col-sm-9"><!--左边大半边div-->

                    <?php
//                    var_dump($data['videos']['1']['typename']);
//                    var_dump($data['videos']['0']['list']);
//                    var_dump($data['videos']);
                    $count = 0;
                    foreach ($data['videos'] as $videos){
                        ?>
                        <div class="row text-center">
                        <div class="col-xs-12 col-lg-12 mlist">
                        <?php
                        echo "<h2>".$videos['typename']."</h2>";
                        echo  "<ul class="."list-inline row text-center".">";
                        foreach ($videos as $video){
                            foreach ($video as $list){
                            ?>
                        <li class="col-xs-4 col-sm-3 col-lg-2">
                            <?php
                                $count++;
//                            var_dump($list['tid']);
                            ?>
                            <img src="images/<?php echo $list['pic'];?>" class="responsive img-thumbnail">
                            <p><a href="index.php?c=index&m=detail&vid=<?php echo $list['vid'];?>"><?php echo $list['videoname'];?></a>
                            </p>
                        </li>
                    <?php
                            }

                    ?>
                    <?php
                        }
                    ?>
                    </ul>
                    <p><a class="btn btn-default text-center" href="index.php?c=index&m=listPage&tid=<?php echo $videos['tid'];?>" role="button">更多 &raquo;</a></p>
                    </div>
                </div>
                    <?php
                    }
                    ?>
        </div><!--左大半边div end-->



        <div class="col-xs-6 col-sm-3 sidebar-offcanvas"><!--右边两个排行的总div-->


            <div class="list-group text-center" id="sidebar">
                <h2 style="color:white;" >点击排行</h2>
                <ul class="list-inline row text-center">
                    <?php
                        foreach ($data['rankList'] as $ranklist){
                    ?>
                    <li class="col-xs-12 col-lg-6">
                        <img src="images/<?php echo $ranklist['pic']; ?>" class="responsive img-thumbnail"/>

                        <p><a href="index.php?c=index&m=detail&vid=<?php echo $ranklist['vid']; ?>"><?php echo $ranklist['videoname']; ?></a>
                        </p>
                    </li>
                    <?php
                        }
                    ?>
                </ul>
            </div>


            <div class="list-group text-center" id="sidebar">
                <h2 style="color:white;" >下载排行</h2>
                <ul class="list-inline row text-center">
                    <?php
                    foreach ($data['hotList'] as $hotlist){
                        ?>
                        <li class="col-xs-12 col-lg-6">
                            <img src="images/<?php echo $hotlist['pic']; ?>" class="responsive img-thumbnail"/>

                            <p><a href="index.php?c=index&m=detail&vid=<?php echo $hotlist['vid']; ?>"><?php echo $hotlist['videoname']; ?></a>
                            </p>
                        </li>
                        <?php
                    }
                    ?>
                </ul>
            </div>

        </div><!--右边两个排行的总div-->
        <!--/.sidebar-offcanvas-->
    </div><!--倒数第二大div-->
    <!--/row-->

</div>
<!--/.container-->
<hr>

<footer>
    <p>&copy; Daniel 2016</p>
</footer>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>

<script src="offcanvas.js"></script>
<script>
    $('.carousel').carousel({
        interval: 3000 //changes the speed
    })
</script>
</body>
</html>
